package cn.edu.cuc.yjsy.admin.connection;

import java.sql.DriverManager;
import java.sql.SQLException;

import cn.edu.cuc.yjsy.admin.util.ILogger;
import cn.edu.cuc.yjsy.admin.util.LoggerAdvisor;

public class DBConnection extends AbstractConnection {

	private ILogger logger = new LoggerAdvisor(DBConnection.class);
	private String driver;
	private String url;
	
	public DBConnection(String driver, String url){
		this.driver = driver;
		this.url = url;
		
		try {
			Class.forName(this.driver);
		} catch (ClassNotFoundException e) {
			logger.error("Register JDBC driver: " + this.driver);
		}
	}
	/**
	 * @Override
	 */
	public void connection() throws SQLException {
		conn = DriverManager.getConnection(url);
	}


}
